/**
 * 研究方向 
 * 
 * 研究方向和老师多对多
 * 研究方向和题目一对多
 * 
 */
package com.zgt.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "t_research")
public class Research {
	private int id;
	private String name;
	private List<Teacher> teachres = new ArrayList<Teacher>();
	private List<Topic> topics = new ArrayList<Topic>();

	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@ManyToMany(mappedBy = "researchs", fetch = FetchType.LAZY)
	public List<Teacher> getTeachres() {
		return teachres;
	}

	public void setTeachres(List<Teacher> teachres) {
		this.teachres = teachres;
	}

	@OneToMany(mappedBy = "research", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	public List<Topic> getTopics() {
		return topics;
	}

	public void setTopics(List<Topic> topics) {
		this.topics = topics;
	}

}
